﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MuaChung.Models.CouponView>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	GetListCoupon
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>GetListCoupon</h2>
    <div id="Message">
        <%: ViewData["Message"] %>
    </div>
    <% using(Html.BeginForm()){ %>
    Chọn dịch vụ mà bạn muốn lấy danh sách coupon:
    <div id="SelectWSCoupon">
        <script type="text/javascript">
            GetContent("/Service/SelectWSCoupon?type=biz", "SelectWSCoupon");
        </script>
    </div>
    <input type="submit" value="Get"/>
    <%} %>
    <%if (ViewData["status"].ToString() == "Error")
      {%>
          
     <%}
      else if (ViewData["status"].ToString() == "Empty")
      {%>
          Không nhận được sản phẩm nào!
      <%}
      else
      {%>              
    <div id="ListCoupon">
    <%using (Html.BeginForm("RegisterCoupon", "Service", FormMethod.Post, Model))
      { %>
    <h2>Danh sách coupon nhận được:</h2>
    <input type="hidden" name="wsID" value="<%: ViewData["wsID"] %>" />
    <table>
    <tr>
        <th></th>
        <th>Mã Coupon</th>
        <th>Tên mặt hàng</th>
        <th>Thông tin mô tả</th>
    </tr>
        <%foreach (var item in Model)
          {%>
              
                <tr id="<%: item.cp.MaCoupon %>" class="ListTR" onmouseover="javascript:OverOut('<%: item.cp.MaCoupon %>',1)" onmouseout="javascript:OverOut('<%: item.cp.MaCoupon %>',0)">
                    <td>
                        <%if (item.status == 1)
                          {%>
                              <input type="checkbox" name="<%: item.cp.MaCoupon%>" disabled="disabled"/>
                          <%}
                          else
                          {%>
                              <input type="checkbox" name="<%: item.cp.MaCoupon%>"/>
                          <%} %>                        
                    </td>
                    <td>
                        <%: item.cp.MaCoupon%>
                    </td>
                    <td>
                        <%: item.cp.TenMatHang%>
                    </td>
                    <td>
                        <%: item.cp.ThongTinMoTa%>
                    </td>
                </tr>
              
          <%} %>
          </table>
          <input type="submit" value="Đăng ký" />
     <%} %>
    </div>
    <%} %>

</asp:Content>

